<include file="Home/Public/Header" />
  <link href="__CSS__/common.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" type="text/css" href="__CSS__/global.css">
  <link href="__CSS__/global_new.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" type="text/css" href="__CSS__/Public.css">
  <link rel="stylesheet" type="text/css" href="__CSS__/Personal.css">
  <link rel="stylesheet" type="text/css" href="__CSS__/date/dateRange.css"/>
  <script type="text/javascript" src="__SCRIPT__/date/dateRange.js"></script>
  <script type="text/javascript" src="__SCRIPT__/jquery-1.8.3.min.js"></script>
  <style type="text/css">
    .header {
      height:105px;
    }
    .size_selected {
      border:#f90 solid 1px;
      color:#f90;
      width:16px;
      height:16px;
      line-height:16px;
    }
    .cxFormtime {
      width: 69px;
      height:21px;
      margin-left:10px;
      border: medium none;
      cursor: pointer;
    }

    .downContent ul li {
      float:left;
      list-style-type:none;
    }
    .search_time_span {
      margin: 0 2px;
      background-color: #EFEFEF;
      border: 1px solid;
      padding: 4px;
    }
    .search_time_span_select {
      margin: 0 2px;
      background-color: #3D86EA;
      border: 1px solid #3D86EA;;
      padding: 4px;
      color: white;
    }
    .confirm_button {
      color: #fff;
      /*line-height: 1px;*/
      background: #06c;
      text-align: center;
      float: left;
      display: block;
      padding: 0 10px;
      text-decoration: none;
    }
    .downContent ul li {
      float:left;
      list-style-type:none;
    }
    .bail_notopeneds {
      background: #ffeaea;
      border: solid #ffabab 1px;
      padding: 10px;
      text-align: left;
      width:300px;
      margin-top:10px;
    }
    .sem-button {
      font-size:12px;
      cursor: pointer;
      display: inline-block;
      min-height: 1em;
      outline: 0;
      border: none;
      vertical-align: baseline;
      background: #E0E1E2;
      color: rgba(0, 0, 0, .6);
      font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
      margin: 0 .25em 0 0;
      padding: 1px 6px;
      text-transform: none;
      text-shadow: none;
      font-weight: 700;
      line-height: 1em;
      font-style: normal;
      text-align: center;
      text-decoration: none;
      border-radius: .28571429rem;
      box-shadow: 0 0 0 1px transparent inset, 0 0 0 0 rgba(34, 36, 38, .15) inset;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      -webkit-transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease;
      transition: opacity .1s ease, background-color .1s ease, color .1s ease, box-shadow .1s ease, background .1s ease;
      will-change: '';
      -webkit-tap-highlight-color: transparent;
      -webkit-appearance: button;
      font: inherit;
      letter-spacing: normal;
      word-spacing: normal;
    }
    .sem-button.primary {
      background-color: #2185D0;
      color: #FFF;
      text-shadow: none;
      background-image: none;
      box-shadow: 0 0 0 0 rgba(34, 36, 38, .15) inset;
    }
    .sem-button.primary:hover {
      background-color: #1678c2;
      color: #FFF;
      text-shadow: none;
    }
    .sem-button.orange {
      background-color: #F2711C;
      color: #FFF;
      text-shadow: none;
      background-image: none;
    }
    .sem-button.orange:hover {
      background-color: #f26202;
      color: #FFF;
      text-shadow: none;
    }
    .sem-button.large {
      padding: 6px 12px;
      font-siez:14px;
    }
  </style>

</head>
<body>

<!--头部开始-->
<include file="Home/Public/top_box" />
<include file="Home/Public/Search" />


<!--头部结束-->
<div class="clear"></div>
<div class="center yxlb">您的当前位置是：首页 - <span style="color:#3366cc">我的购买订单</span></div>
<div class="clear"></div>
<div class="center">
  <script src="__SCRIPT__/jquery-1.8.3.min.js"></script>
  <script src="__SCRIPT__/jquery.timer.js"></script>
  <include file="Home/Member/LeftBar"/>
  <script type="text/javascript">
    var address = window.location.href.substring(window.location.href.lastIndexOf('/'));
    $('.personal_left ul li a').removeClass('global_a_hover');
    $.each($('.personal_left ul li'), function(i, item){
      var href = $(item).children('a').attr('href');
      href = href.substring(href.lastIndexOf('/'));
      if (address.indexOf(href) != -1) {
        $(item).children('a').addClass('global_a_hover');
      }
    });
  </script>
  <div class="personal_right">
    <div class="ddgl">
      <h1>我购买的订单</h1>
      <form id="queryForm" method="post">
        <div class="yxddcx">
          <ul>
            <li style="line-height:28px;"> <span style="float:left;">订 单 时 间：</span>

              <div class="ta_date" id="div_date1">
                <span class="date_title" id="date1"></span>
                <a class="opt_sel" id="input_trigger1" href="#">
                  <i class="i_orderd"></i>
                </a>
              </div>
              <div id="datePicker1"></div>

              <span style="margin-left:62px"></span>

              <!--<span class="timespan">
              	<a href="javascript:void(0);" class="search_time_span" id="aTodayDemo1">今天</a>
                <a href="javascript:void(0);" class="search_time_span" id="aRecent30DaysDemo1">最近1个月</a>
                <a href="javascript:void(0);" class="search_time_span" id="aRecent90DaysDemo1">3个月</a>
                <a href="javascript:void(0);" class="search_time_span" id="aRecent1YearDemo1">最近1年</a>
              </span>-->

              <script type="text/javascript">

                //var STATS_START_TIME = '1329148800';
                var dateRange1 = new pickerDateRange('date1', {
                  isTodayValid : true,
                  aToday : 'aTodayDemo1', //今天
                  aRecent30Days : 'aRecent30DaysDemo1', //最近30天
                  aRecent90Days : 'aRecent90DaysDemo1', //最近90天
                  aRecent1Year : 'aRecent1YearDemo1',//最近1年
                  startDate : '{$startDate}',
                  endDate : '{$endDate}',
                  needCompare : false,
                  defaultText : ' 至 ',
                  autoSubmit : true,
                  inputTrigger : 'input_trigger1',
                  theme : 'ta',
                  magicSelect : false,

                });
                $(".timespan a").click(function(){
                  $(".timespan a").removeClass("search_time_span_select");
                  $(this).addClass("search_time_span_select");
                });
              </script>

            </li>
            <li> 订 单 编 号：
              <input name="order_sn" size="28" value="{$order_sn}">
              <input type="hidden" name="status" value="{$status}">
              <input type="submit" value="" class="cxFormtime" id="btnQuery">
              <script type="text/javascript">
                $('.cxFormtime').click(function(){
                  $('#queryForm').append($('#startDate'));
                  $('#queryForm').append($('#endDate'));
                });
              </script>
            </li>
          </ul>
        </div>
        <div class="yxddlb">
          <div id="nave">
            <ol>
              <if condition="$status === ''">
                <a class="a_hover">全部</a>
                <else />
                <a href="{:U('Home/Member/MyOrderList')}">全部</a>
              </if>
            </ol>
            <ol>
              <if condition="$status == '0'">
                <a class="a_hover">已完成订单</a>
                <else />
                <a href="{:U('Home/Member/MyOrderList', array('status'=>0))}">已完成订单</a>
              </if>
            </ol>
            <ol>
              <if condition="$status == '-1'">
                <a class="a_hover">已取消订单</a>
                <else />
                <a href="{:U('Home/Member/MyOrderList', array('status'=>-1))}">已取消订单</a>
              </if>
            </ol>
            <ol>
              <if condition="$status == '1'">
                <a class="a_hover">等待付款</a>
                <else />
                <a href="{:U('Home/Member/MyOrderList', array('status'=>1))}">等待付款</a>
              </if>
            </ol>
            <ol>
              <if condition="$status == '2'">
                <a class="a_hover">等待收货</a>
                <else />
                <a href="{:U('Home/Member/MyOrderList', array('status'=>2))}">等待收货</a>
              </if>
            </ol>
          </div>
          <div class="ddxq">
            <ul>
              <li class="spmc">商品名称</li>
              <li class="zj">总价</li>
              <li class="sl">数量</li>
              <li class="khfw">客户服务</li>
              <li class="ddzt">订单状态</li>
            </ul>
          </div>

          <volist name="list" id="vo">
            <div id="menud_con">
              <div class="ddlb">
                <h1>订单编号：{$vo.order_sn}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;创建时间：{$vo.order_time|date='Y-m-d H:i:s', ###}</h1>
                <ul class="clearfix" goodsid="{$vo.goods_id}">
                  <ol class="spmc">
                  <span style="color:#36c"> <img src="__IMAGE__/common/buy_ji.png"> {$vo.goods_title}
                  {$vo.gc_name} </span><br>
                    游戏区服：
                    <volist name="vo.goods_relation" id="vor" key="key">
                      <php>$t = count($vo['goods_relation']);</php>
                      <if condition="$key gt 1">
                        <a href="javascript:;" class="gray">{$vor.gc_name}</a> <if condition="$key lt $t">/</if>
                      </if>
                    </volist>
                  </ol>
                  <ol class="zj">
                    <php>
                      $total_price = price($vo['order_price'] * $vo['order_number'], false);
                    </php>
                    <span style="color:#F90">{$total_price}</span>元
                  </ol>
                  <ol class="sl">
                    {$vo.order_number} <br>{$vo['deadline']}
                  </ol>
                  <ol class="khfw">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  </ol>

                  <switch name="vo.order_real_status">
                    <case value="0">
                      <ol class="ddzt">
                        <a>订单已完成</a>
                      </ol>
                    </case>
                    <case value="1">
                      <ol class="ddzt">
                        <a>等待付款</a><br>
                        <a class="cs" href="{:U('Home/Buy/Pay', 'sn='.$vo['order_sn'])}"><img src="__IMAGE__/Personal/dfk.png" width="69" height="21"></a><br>
                        <a class="confirm_cancel" href="{:U('Home/Buy/CancelOrder','sn='.$vo['order_sn'])}">取消订单</a>
                      </ol>
                    </case>
                    <case value="2">
                      <ol class="ddzt">
                        <a class="status_text">已付款，等待发货</a><br>
                        <div id="timer{$vo.order_sn}"></div><br>
                        <script>
                          var t_{$vo.order_sn} = $('#timer{$vo.order_sn}');
                          t_{$vo.order_sn}.timer({
                            now:{:time()},
                            count: {$config['SEND_EXPIRE']}, //seconds, 过期时间
                            offset:{$vo.pay_time},
                            overtime: function(e){
                              e.html('<a href="http://wpa.qq.com/msgrd?v=3&uin={:C('SERVICEQQ')}&site=qq&menu=yes" target="_blank">请联系客服处理</a>');
                              t_{$vo.order_sn}.siblings('a.status_text').html('卖家发货超时');
                            }
                          });
                        </script>
                      </ol>
                    </case>
                    <case value="3">
                      <ol class="ddzt">
                        <a>卖家已发货</a><br>
                        <div id="timer{$vo.order_sn}"></div>
                        <a class="dkf cs" href="{:U('Home/Buy/ReceivedGoods', 'sn='.$vo['order_sn'])}"><img src="__IMAGE__/Personal/dkf.png" width="69" height="21"></a>
                        <script>
                          $('#timer{$vo.order_sn}').timer({
                            now:{:time()},
                            count: {$config['CONFIRM_EXPIRE']}, //seconds, 过期时间
                            offset:{$vo.send_time},
                            overtime: function(e){
                              e.html('确认收货超时');
                              $('#bbb').hide();
                            }
                          });
                        </script>
                      </ol>
                    </case>
                    <case value="4">
                      <ol class="ddzt">
                        <a>已确认收货</a>
                      </ol>
                    </case>
                    <case value="-1">
                      <ol class="ddzt">
                        订单已取消
                        <div class="tsgrzx" onmousemove="javascript:$('#prompt_{$vo.order_sn}').show();" onmouseout="javascript:$('#prompt_{$vo.order_sn}').hide();"><img src="__IMAGE__/common/qxyy.png"></div>
                      </ol>
                      <ol id="prompt_{$vo.order_sn}" marginpt="-1" type="revoke" class="prompt" superbillid="{$vo.order_sn}" style="display: none;">
                        <div style="width:205px; height:65px; margin:0 auto; margin-top:12px;">{$vo.order_remark|replacement=###,'系统自动撤单'}</div>
                      </ol>
                    </case>
                    <case value="-2">
                      <ol class="ddzt">
                        <a>卖家发货超时</a><br>
                        <a href="http://wpa.qq.com/msgrd?v=3&uin={:C('SERVICEQQ')}&site=qq&menu=yes" target="_blank">请联系客服处理</a> <!-- 联系客服页面 -->
                      </ol>
                    </case>
                    <case value="-3">
                      <ol class="ddzt">
                        <a>确认收货超时</a><br>
                        <a href="javascript:;">等待客服处理</a>
                      </ol>
                    </case>
                    <case value="-4">
                      <ol class="ddzt">
                        买家退款成功
                        <div class="tsgrzx" onmousemove="javascript:$('#prompt_{$vo.order_sn}').show();" onmouseout="javascript:$('#prompt_{$vo.order_sn}').hide();"><img src="__IMAGE__/common/qxyy.png"></div>
                      </ol>
                      <ol id="prompt_{$vo.order_sn}" marginpt="-1" type="revoke" class="prompt" superbillid="{$vo.order_sn}" style="display: none;">
                        <div style="width:205px; height:65px; margin:0 auto; margin-top:12px;">{$vo.order_remark}</div>
                      </ol>
                    </case>
	                  <case value="-5">
		                  <ol class="ddzt">
			                  支付超时
		                  </ol>
	                  </case>
                  </switch>
                </ul>
              </div>
            </div>
          </volist>

          <script type="text/javascript">
            $('.confirm_cancel').click(function(){
              if( ! window.confirm('您确认要取消此订单吗?') ){
                return false;
              }
            });
          </script>
          <!--页码-->
          <div class="page">
            {$page}
          </div>

          <div class="clear"></div>
        </div>
      </form>
    </div>
  </div>
</div>
<div class="center" style="border-bottom:1px solid #CAC9C9; width:100%; height:1px; margin-top:10px;"></div>

<!--底部开始-->
<include file="Home/Public/footer" />
<!--底部结束-->

</body>
</html>